////////////////////////////////////////////////////////////////////////////////
//
//  FLYING KIWI BV
//  Copyright 2010 Flying Kiwi BV
//  All Rights Reserved.
//
//  NOTICE: Flying Kiwi permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
package plantool.modules.orders.data {
	//--------------------------------------------------------------------------
	//  Imports
	//--------------------------------------------------------------------------
	import plantool.core.CoreObject;
	import plantool.data.DatabaseManager;
	
	
	//--------------------------------------------------------------------------
	//  [Metadata (Events, Style, Effects etc)]
	//--------------------------------------------------------------------------
	
	//--------------------------------------------------------------------------
	//  Class declaration
	//--------------------------------------------------------------------------
	[Bindable]
	public class Orderplanning extends CoreObject {
		//--------------------------------------------------------------------------
		//Class constants
		//--------------------------------------------------------------------------
		
		//--------------------------------------------------------------------------
		//Class variables
		//--------------------------------------------------------------------------
		private var _timestamp:Number	= 0;
		private var _date:Date			= null;
		public var id:uint				= 0;
		public var order_id:uint		= 0;
		public var orderrow_id:uint		= 0;
		public var related_id:uint		= 0;
		public var time:Number			= 0;
		public var ready:Boolean		= false;
		
		//--------------------------------------------------------------------------
		//Class properties
		//--------------------------------------------------------------------------
		public function get date():Number { return _timestamp; }
		public function set date(value:Number):void { _timestamp = value; _date = DatabaseManager.getInstance().createDateFromTimestamp(date); }
		public function get fromDate():Date {
			return _date;
		}
		public function set fromDate(value:Date):void {
			_date = value;
		}
		
		//--------------------------------------------------------------------------
		//Constructor and Destructor
		//--------------------------------------------------------------------------
		public function Orderplanning() {
			super();
		}
		
		//--------------------------------------------------------------------------
		//Class methods
		//--------------------------------------------------------------------------
	}
}